#include<stdio.h>
int main(){
	int n,m;
	scanf("%d",&n);
	for(m=1;m<=n;m++){
		int num,i,g=0;
		scanf("%d",&num);
		for(i=2;i<=num;i+=2){
			if(num%i==0){
			printf("%d ",i);
			g++;}
		}
		if(g==0)
		printf("%d has no even factors\n",num);
	    if(g!=0)
	    printf("\n");
	}
}
